//
//  EasyChallenge.m
//  Tables
//
//  Created by mathias Muller on 9/3/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "EasyChallenge.h"


@implementation EasyChallenge
- (id)init {
	if (self = [super init]) {
		if(![EasyChallenge isRandom]) {
			self.challengeLength = 10 * (int) [self getNbSelectedNumber];
		} else {
			self.challengeLength = [[NSUserDefaults standardUserDefaults]  integerForKey:@"LENGTH"];
		}
	}
	return self;
}


-(NSInteger) getRandomLeftNumber {
	return[self getRandomNumber];
}

-(NSInteger) getRandomRightNumber {
	return [self getValidRandomNumber];
}


+(NSString *) getOperator {
	return [[NSUserDefaults standardUserDefaults]  objectForKey:@"OPERATOR"];
}
+(void) setOperator:(NSString *) op {
	return [[NSUserDefaults standardUserDefaults]  setObject:op	forKey:@"OPERATOR"];
}

+(BOOL) isRandom {
	return [[NSUserDefaults standardUserDefaults]  integerForKey:@"RANDOM"];
}
+(void) setRandom:(BOOL) v {
	return [[NSUserDefaults standardUserDefaults]  setInteger:v forKey:@"RANDOM"];
}
- (NSString *) getOperator {
	return [[NSUserDefaults standardUserDefaults]  objectForKey:@"OPERATOR"];
}


@end
